﻿USE [HR_DB]
GO
if exists(select * from dbo.sysobjects where id = object_id(N'users_bak')   and   OBJECTPROPERTY(id,   N'IsUserTable')   =   1)   
  drop table users_bak   
-- =============================================
-- Author:杨洁(kaixuanpisces)
-- Create date: 20090728
-- Description:	用户表信息备份
-- =============================================
CREATE TABLE [dbo].[users_bak](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[u_id] [smallint] NOT NULL,
	[u_name] [varchar](60) NOT NULL,
	[u_true_name] [varchar](60) NOT NULL,
	[u_password] [char](32) NOT NULL,
	[u_start_time] [smalldatetime] NOT NULL,
	[u_end_time] [smalldatetime] NOT NULL,
	[u_status] [char](1) NOT NULL,
 CONSTRAINT [PK_users_bak] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO

-- ==============================================
-- 列名说明
-- ==============================================
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识列,自增长' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'真实姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_true_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_password'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_start_time'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_end_time'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:1修改/2删除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'users_bak', @level2type=N'COLUMN',@level2name=N'u_status'